<?php

namespace app\adminmall\controller;
use app\admin\model\Member as MemberModel;
use app\common\controller\AdminBaseController;
use think\Db;
/**
 * 会员分类统计
 */
class MemberRatioController extends AdminBaseController
{
 	protected $model;
	
    protected function _initialize() {
        parent::_initialize();
        $this->model = new MemberModel();
    }
    /**
     * 会员统计
     * @author [lx] 
     */
    public function index( $page = 1){
		//普通会员统计
		$ptmember = Db::name("__member__")->where('agent_type','1')->count('id');
        $this->assign('ptmember',$ptmember);
		
		//代理商统计
		$dlmember = Db::name("__member__")->where('agent_type','2')->count('id');
        $this->assign('dlmember',$dlmember);
		
		//合伙人统计
		$hhmember = Db::name("__member__")->where('agent_type','3')->count('id');
        $this->assign('hhmember',$hhmember);
		
		//全部会员统计
		$sum = Db::name("__member__")->count('id');
        $this->assign('sum',$sum);
        return $this->fetch();
    }


   
}